package com.itheima.manager;

import com.itheima.service.db.SmsHomeBrandService;
import com.itheima.service.db.SmsHomeNewProductService;
import com.itheima.util.R;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class SmsHomeManager {
    @DubboReference
    SmsHomeBrandService smsHomeBrandService;

    public R findByPage(Integer pageNum, Integer pageSize,String brandName,Integer recommendStatus) {
        return R.success(smsHomeBrandService.findByPage(pageNum, pageSize,brandName,recommendStatus));
    }

    public R updateRecommendStatus(List<Long> ids, Integer recommendStatus) {
        for (Long id : ids) {
            smsHomeBrandService.updateRecommendStatus(id,recommendStatus);
        }
        return R.success(null);
    }

}
